#include "CBondComparator.h"
#include "CBrokerKeyList.h"

CBondComparatorIndirect::CBondComparatorIndirect( CBrokerKeyList* del ) :m_delegate(del)
{

}

CBondComparatorIndirect::CBondComparatorIndirect( const CBondComparatorIndirect& cmp ) :m_delegate(cmp.m_delegate)
{

}

CBondComparatorIndirect& CBondComparatorIndirect::operator=( const CBondComparatorIndirect& cmp )
{
	m_delegate = cmp.m_delegate; 
	return *this;
}

int CBondComparatorIndirect::operator()( const BrokerKeyInfo& b1, const BrokerKeyInfo& b2 ) const
{
	return m_delegate->CompareBond(b1, b2);
}

int CBondComparatorIndirect::GetExpandLength( int count, int length )
{
	return length * 2; /*hashmap每次以2倍速度扩充*/
}